<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../base.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<sys:genericTag4o id="columnsTag" methodName="getColumnList" className="com.tmpt.controller.taglib.TemplateTag">
	<sys:columnTag columnName="keyRandom" columnValue="${paramValues._keyRandom[0]}"/>
</sys:genericTag4o>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

<title></title>

<link href="${path}/admin123/css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui1.5/themes/bootstrap/easyui.css"/>
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui1.5/themes/icon.css"/>
<script type="text/javascript" src="${path}/js/jquery-1.8.0.min.js"></script>
<script src="${path}/js/jquery/easyui1.5/jquery.easyui.min.js"></script>
<script src="${path}/js/jquery/easyui1.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${path}/js/jquery.select.js"></script>

<style type="text/css">
	#layoutui { margin:5px;}
	#layoutui ol {  margin: 0;padding:5px;list-style: none;}
	#layoutui ol li{
		margin: 1px; padding-left:5px; padding-top:4px;
		float:left;
		width:300px; height:30px;
		background-color: #efefef;
		border: 1px solid #ddd;
	}
	#layoutui label{width:100px;float:left; border-bottom:0px solid #fff;}
	.clear_div{clear:both;}
</style>
<script type="text/javascript">
	var _path = '${path}';
	var _keyRandom='${paramValues._keyRandom[0]}';
	var _primaryKey='${columnsTag.templateTable.primaryKey}';
	var _isdialog4AddDialog = '${columnsTag.templateTable.isdialog4AddDialog}';

	//Add dialog 中combobox 选择时，看看哪些字段不用输入，直接隐藏了
	var _columnCombobox4AddArray = new Array();
	var _columnCombobox4AddJsonArray = new Array();

	//所有列备份一下，一会隐藏了，可以恢复
	var _columnDivArray = new Array();


	//row data
	var _parameter1_iframedialog = '${paramValues.parameter1_iframedialog[0]}';
	_parameter1_iframedialog = decodeURI(_parameter1_iframedialog);
	_parameter1_iframedialog = decodeURI(_parameter1_iframedialog);
	_parameter1_iframedialog = decodeURI(_parameter1_iframedialog);
	_parameter1_iframedialog = JSON.parse(_parameter1_iframedialog);

	var _parameter2_iframedialog = '${paramValues.parameter2_iframedialog[0]}';
	_parameter2_iframedialog = JSON.parse(_parameter2_iframedialog);

	/*var _parameter2_iframedialog = ${paramValues.parameter2_iframedialog[0]};
	var _parameter3_iframedialog = ${paramValues.parameter3_iframedialog[0]};*/
</script>
<script type="text/javascript" src="${path}/js/myjs/template_adddata.js?random=<%=Math.random()%>"></script>

</head>
<body class="font14">
	<input type="hidden" id="_defaultValueJOStr" size=200 value='${columnsTag.defaultValueJOStr}'/>

	<form id="form_add" method="post">
		<input type="hidden" id="${columnsTag.templateTable.primaryKey}" name="${columnsTag.templateTable.primaryKey}"/>
		<s:if test="#attr.columnsTag.templateTable.isdialog4AddDialog!=1">
		<div id="layoutui" style="<s:if test="#attr.columnsTag.templateTable.style4AddDialog!=''"> ${columnsTag.templateTable.style4AddDialog}</s:if><s:else>width:800px;height:400px</s:else>">
		</s:if>
		<s:else>
		<div id="layoutui">
		</s:else>

			<ol>
				<s:iterator var="item" value="#attr.columnsTag.column4Add" status="st" >
				<li id="_${item.columnName}_line" class="text"  title="${item.columnTip}" <s:if test="#item.columnLayoutStyle4adddialog!=null && #item.columnLayoutStyle4adddialog!=''">style="${item.columnLayoutStyle4adddialog}"</s:if>>
					<script type="text/javascript">
						//所有列备份一下，一会隐藏了，可以恢复
						_columnDivArray[_columnDivArray.length] = '#_${item.columnName}_line';
					</script>
					<label >${item.columnShowName}</label>

					<input class="${item.columnType}" name="${item.columnName}" id="${item.columnName}4Add"

						<s:if test="#item.dataOptions4AddDialog!=null && #item.dataOptions4AddDialog!=''">data-options=${item.dataOptions4AddDialog}</s:if><s:else>data-options={"valueField":"keyName","textField":"valueName"}</s:else>
						/>
					<s:if test="#item.a1TemplateColumnOptionJsonArray!='' && #item.columnType=='easyui-combobox'">
					<script type="text/javascript">
						_columnCombobox4AddJsonArray[_columnCombobox4AddJsonArray.length] = '${item.a1TemplateColumnOptionJsonArray}';
						_columnCombobox4AddArray[_columnCombobox4AddArray.length] = '${item.columnName}4Add';
					</script>
					</s:if>
				</li>
				</s:iterator>
			</ol>
			<div style="clear:both;"></div>
			<!-- 添加弹出框 Buttons -->
			<div style="background-color: #fff; text-align: center;margin-top:10px;">
				<table cellpadding="0" cellspacing="0" style="width:100%">
					<tr>
						<td style="text-align:center;">
							<a href="${path}/admin123/layoutui/layoutUI.jsp?_keyRandom=${paramValues._keyRandom[0]}" target="_blank" class="easyui-linkbutton" iconCls="icon-edit">定制布局</a>
							<s:if test="#attr.columnsTag.templateTable.isdialog4AddDialog!=1">
								<a href="#" id="form_addButton" class="easyui-linkbutton" iconCls="icon-save">保存</a>
							</s:if>
						</td>
					</tr>
				</table>
			</div>

			<div style="height: 20px;"></div>
		</div>


	</form>

</body>
</html>




